package com.watermoniter;

import android.app.Application;

import com.videogo.openapi.EZOpenSDK;
import com.watermoniter.util.StringUtil;
import com.watermoniter.util.WMPref;

/**
 * Created by mike.min on 2018/1/2.
 */

public class MyApp extends Application {

    private static final String AppKey = "a89789fbbb70468d9669348056f6acb5";

    public static EZOpenSDK getOpenSDK() {
        return EZOpenSDK.getInstance();
    }

    public static String URL_Domain;
    public static String Device_No;

    @Override
    public void onCreate() {
        super.onCreate();

        initSDK();

        if(StringUtil.isEmpty(WMPref.getInstance(this).getIP())){
            WMPref.getInstance(this).setIP("http://119.23.134.247/");
        }

    }

    private void initSDK() {
        /**
         * sdk日志开关，正式发布需要去掉
         */
        EZOpenSDK.showSDKLog(BuildConfig.DEBUG);

        /**
         * 设置是否支持P2P取流,详见api
         */
        EZOpenSDK.enableP2P(true);

        /**
         * APP_KEY请替换成自己申请的
         */
        EZOpenSDK.initLib(this, AppKey, "");
    }
}
